Generally, non-liner filtering is used in image processing to reduce noise and improve the signal and sharpness of images. The median filter is a form of nonlinear digital filtering technique, typically used to remove noise from images. Such noise reduction is a typical pre-processing step to improve results of an image. Median filtering preserves edges of images while removing noise. Median filtering is useful in reducing impulsive, or salt-and-pepper noise. It preserves edges in an image while reducing random noise. In median filtering processing, signal values are processed entry by entry and each entry is replaced by the median of neighboring entries. The pattern of neighbors is selected using a sliding ‘window’, which slides through each entry over the entire signal. For simple 1-D image signals, the sliding window captures first few preceding and following entries where for 2-D (or higher-dimensional) signals more complex window patterns are used such as for example, a box or cross patterns.
Various sizes of windows are used to process image values such as for example window sizes of 2×2, 3×3, 2×3, and the like. The median of a group of signal values within a window is calculated by sorting all the pixel values from the window into numerical order and then replacing the actual pixel value with the middle (median) pixel value and the median intensity value of the pixel becomes the output intensity of the pixel. Conventionally, all values in a given window are processed to calculate the median value of a given sliding window. To process all values of image signal in a given sliding window, even with vector processing, excessive amount of processing power is needed to identify a median value of each pixel in a window of pixel values. Further, processing all image signal values of a given window causes inefficiency in signal processing and reduces throughput.